Skip to content

feat: join protocol threads with canonical sessions - #191

Merged
oratis merged 18 commits into
mainfrom
codex/canonical-thread-store
Aug 2, 2026
Merged

feat: join protocol threads with canonical sessions#191
oratis merged 18 commits into
mainfrom
codex/canonical-thread-store

Conversation

@oratis

@oratis oratis commented Aug 1, 2026

Copy link
Copy Markdown
Owner

Summary

  • materialize each protocol thread under the same id in canonical session-v1 JSONL
  • retain rich lifecycle snapshots under threads-v1 while keeping existing CLI/desktop session indexes continuous
  • lazily import canonical or legacy-only sessions as completed compatibility turns on first protocol resume
  • preserve titles written by compatible clients and use the shared cross-process writer lock
  • expose an idempotent SessionManager materialization boundary

Validation

  • pre-commit format, lint, typecheck, and all workspace tests passed
  • 954 TypeScript tests passed / 12 skipped
  • store tests cover canonical index projection, exact history, user-title preservation, and legacy import
  • bundled CommonJS sidecar built successfully (227,374 bytes)
  • real stdio thread/start created matching threads-v1 and sessions/*.v1.jsonl files in a temporary DEEPCODE_HOME

Stack

Base: #190

@oratis
oratis force-pushed the codex/interactive-protocol branch from 8d0c7ac to 1ad4039 Compare August 1, 2026 07:05
@oratis
oratis force-pushed the codex/canonical-thread-store branch from 801b4de to 1a92767 Compare August 1, 2026 07:05
@oratis
oratis force-pushed the codex/interactive-protocol branch from 1ad4039 to 580f9c8 Compare August 1, 2026 07:20
@oratis
oratis force-pushed the codex/canonical-thread-store branch from 1a92767 to 033f7e6 Compare August 1, 2026 07:20
@oratis
oratis changed the base branch from codex/interactive-protocol to main August 2, 2026 06:36
@oratis
oratis marked this pull request as ready for review August 2, 2026 06:40
@oratis

oratis commented Aug 2, 2026

Copy link
Copy Markdown
Owner Author

Review: approved ✅

This is the PR that stops the protocol work from forking session history into a parallel universe, and it takes the conservative route at every choice point.

What I checked

  • Same id in both places. A protocol thread materializes into canonical session-v1 JSONL under the same id, so existing CLI and desktop session indexes stay continuous. Users don't see their history split by which client created it.
  • Rich lifecycle snapshots stay in threads-v1, separate from the canonical stream. Right layering — canonical stays the interoperable format, protocol-specific richness doesn't leak into it.
  • Legacy import is lazy, on first protocol resume, as completed compatibility turns. Lazy means no big-bang migration pass that could damage history; "completed compatibility turns" means imported content can't be mistaken for a resumable live turn.
  • Uses the shared cross-process writer lock from Sessions: canonical v1 writer and cross-process ownership #185 rather than inventing a second one. This is the detail that would have quietly broken concurrent CLI + desktop access if it had been missed.
  • Preserving titles written by compatible clients avoids the annoying regression where resuming a session through a new path blanks its name.
  • The idempotent SessionManager materialization boundary matters because resume can be retried; a non-idempotent version would duplicate turns on a reconnect.

Validation: CI green; full suite green locally at the stack tip.

@oratis
oratis merged commit d786170 into main Aug 2, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant